package com.bos.mapper;

import com.bos.data.model.BosParamModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface Bos_paramMapper {
    //1.查询出Bos_param中的值
    @Select("select * from Bos_param")
    public List<BosParamModel> findParams();

    //2.将模块名称和模块描述插入到数据库表中
    @Insert("insert into bos_param values(#{typeId},#{typeName},#{paramId},#{paramValue},#{updateTime})")
    public int insertParams(BosParamModel param);

    //3.根据paramId来排序，并且查询出paramId的值
    @Select("select top 1 bos_param.paramId,typeId from bos_param  order by paramId desc")
    public BosParamModel findParamId();

    //4.根据id删除Bos_param中的数据
    @Delete("delete from bos_param where id=#{id}")
    public int deleteById(int id);
    //5.根据id修改paramValue的数据
    @Update("update bos_param set paramValue=#{paramValue} where id=#{id}")
    public int updateByParam(BosParamModel paramModel);
}

